<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>什么是编译的作用域</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
    <div id="app">
        <!-- 这里会去找VUE实例里面找 -->
      <cpn2 v-show="isShow"></cpn2>
    </div>
    
    <template id="cpn2">
        <div>
         <h2>我是子组件</h2>
         <!-- 这个是子组件的变量，会去找子组件中的isShow -->
         <button v-show="isShow">按钮</button>
        </div>
    </template>
    <script>
       
        const app = new Vue({
            el: "#app",
            data: {
                message: "你好啊",
                isShow: true
            },
            components:{//局部组件注册语法糖
                cpn2:{
                    template: "#cpn2",
                    data() {
                    return {
                        isShow: false
                    }
                }
                }
                
            }
        })
    </script>
</body>
</html>